import { createRouter, createWebHistory } from 'vue-router'


const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    /* 首页重定向 */
    {
      path: '/',
      redirect: '/login'
    },
    {
      path: '/register',
      name: 'register',
      component: () => import('@/views/Register/Register.vue')
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login/Login.vue')
    },
    {
      path: '/mainMenu',
      name: 'mainMenu',
      component: () => import('../views/MainMenu/mainMenu.vue'),
      redirect: '/Schedule',
      children: [
        {
          path: '/Schedule',
          name: 'Schedule',
          component: () => import('../views/Calendar/calendar.vue')
        },
        {
          path: '/week',
          name: 'week',
          component: () => import('../views/Calendar/calendarByWeek.vue')
        },
        {
          path: '/day',
          name: 'day',
          component: () => import('../views/Calendar/calendarByDay.vue')
        },
        {
          path: '/add',
          name: 'add',
          component: () => import('../views/utils/add.vue')
        },
      ]

    },
  ]
})

export default router
